-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syslog/ramlog: add support of ramlog flush worker #13599
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] The PR does not fully meet the NuttX requirements, specifically in the following areas: Summary:
Impact:
Testing:
Recommendations for Improvement:
By addressing these points, the PR will better adhere to the NuttX requirements and provide reviewers with the necessary context for a comprehensive evaluation. |
1. add RAMLOG_FLUSH options to support flush ramlog buffer to ARCH_LOWPUTC device 2. add RAMLOG_FLUSH_WORKER to support background ramlog flush from workqueue in timeout RAMLOG_FLUSH_WORKER_TIMEOUT_MS Signed-off-by: chao an <[email protected]>
|
||
while (pos != (header->rl_buffer + end) && *pos++ != '\n'); | ||
|
||
up_nputs(start, pos - start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need dup to up_nputs? which may generate the infinite recursion.
---help--- | ||
ROMLOG lower flush worker to flush the ramlog to lower half driver. | ||
|
||
if RAMLOG_FLUSH_WORKER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change RAMLOG_FLUSH_WORKER_TIMEOUT_MS to depend on RAMLOG_FLUSH_WORKER
priv->rl_tail = header->rl_head - priv->rl_bufsize; | ||
} | ||
|
||
begin = priv->rl_tail % priv->rl_bufsize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change begin/end to tail/head
start = header->rl_buffer + begin; | ||
pos = start; | ||
|
||
while (pos != (header->rl_buffer + end) && *pos++ != '\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need find \n
? let's up_nputs handle multiple \n
to \r\n
byself.
|
||
flags = enter_critical_section(); | ||
|
||
if (header->rl_head != priv->rl_tail) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not flush all buffer in once
} | ||
else | ||
{ | ||
if (work_available(&priv->rl_work)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge with line 454
#ifdef CONFIG_RAMLOG_FLUSH | ||
int ramlog_flush(FAR syslog_channel_t *channel) | ||
{ | ||
ramlog_flush_internal(&g_sysdev, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not merge ramlog_flush_internal into ramlog_flush?
Summary
syslog/ramlog: add support of ramlog flush worker
RAMLOG_FLUSH
options to support flush ramlog buffer toARCH_LOWPUTC
deviceRAMLOG_FLUSH_WORKER
to support background ramlog flush from workqueuein timeout
RAMLOG_FLUSH_WORKER_TIMEOUT_MS
Signed-off-by: chao an [email protected]
Impact
N/A
Testing
ci-check